home *** CD-ROM | disk | FTP | other *** search
/ Lattice ISP Synario Start… & ISP Encyclopedia 1997 / LATTICE Synario.iso / ispcode / source / lattice.h < prev   
Encoding:
C/C++ Source or Header  |  1996-06-14  |  4.5 KB  |  124 lines

  1.  
  2. #define    false                        0
  3. #define    true                         1
  4.  
  5. #ifdef     outportb
  6. #undef     outportb
  7. #endif
  8. #ifdef     inportb
  9. #undef     inportb
  10. #endif
  11. #ifdef     outp
  12. #undef     outp
  13. #endif
  14. #ifdef     inp
  15. #undef     inp
  16. #endif
  17. #ifdef     enable
  18. #undef     enable
  19. #endif
  20. #ifdef     disable
  21. #undef     disable
  22. #endif
  23.  
  24.  
  25. #define    inport1                 0x379
  26. #define    outport1                0x378
  27. #define    inport2                 0x279
  28. #define    outport2                0x278
  29. #define    inport3                 0x3BD
  30. #define    outport3                0x3BC
  31.  
  32. #define    ABORT                      -3
  33. #define    UNKNOWN                    -2
  34. #define    OUT_OF_MEMORY              -1
  35. #define    NUL                         0
  36.  
  37. #define    OK                          0
  38. #define    INVALID_CHIP               -4
  39. #define    CABLE_NOT_FOUND            -5
  40. #define    POWER_OFF                  -6
  41. #define    CHIPS_NOT_FOUND            -7
  42. #define    FILE_NOT_FOUND             -8
  43. #define    FILE_NOT_VALID             -9
  44. #define    FILE_TOO_BIG              -10
  45. #define    VALIDATION_ERROR          -11
  46. #define    NO_VERIFY_SEC_FUSE_SET    -12
  47. #define    NON_ISP_PART              -13
  48. #define    UNKNOWN_FUNCTION          -14
  49. #define    TOO_MANY_CHIPS            -15
  50. #define    UNKNOWN_CHIP              -16
  51. #define    FILE_NOT_JEDEC            -17
  52. #define    FILE_ERROR                -18
  53. #define    FILE_UES_INVALID          -19
  54.  
  55. #define    out_SDI                     1    /* weight of output signal lines  */
  56. #define    out_SCLK                    2
  57. #define    out_MODE                    4
  58. #define    out_ISP                     8
  59. #define    out_RESET                  16
  60. #define    out_SENSE_CABLE_OUT        64
  61.  
  62. #define    in_VCC_OK                   8    /* weight of  input signal lines  */
  63. #define    in_CABLE_SENSE_IN          32
  64. #define    in_SDO                     64
  65.  
  66. #define    HIGH                     0x01
  67. #define    LOW                      0x00
  68.  
  69. /* define 5-bit command codes, using 8-bit value, with the 3 MSBs zeroed */
  70. #define NOP                0x00 /* 00000 - No operation */
  71.  
  72. #define SHIFT_ADDRESS      0x01 /* 00001 - Enable address shift register */
  73. #define SHIFT_DATA         0x02 /* 00010 - Enable data shift register    */
  74. #define ARCH_SHIFT         0x14 /* 10100 - Enable arch shift for 22v10   */
  75.  
  76. #define ERASE              0x03 /* 00011 - Erase entire device, except UES */
  77. #define ERASE_ALL          0x10 /* 10000 - Erase entire device, and UES    */
  78.  
  79. #define PROGRAM_HIGH       0x07 /* 00111 - Program high order bits       */
  80. #define PROGRAM_LOW        0x08 /* 01000 - Program low order bits        */
  81. #define PROGRAM_UES        0x0F /* 01111 - Program UES row               */
  82.  
  83. #define SECURE             0x09 /* 01001 - Program security cell         */
  84.  
  85. #define VERIFY_HIGH_PROG   0x0A /* 01010 - Verify high order bits are
  86.                                    programmed (JEDEC zeros)              */
  87. #define VERIFY_LOW_PROG    0x0B /* 01011 - Verify low order bits are
  88.                                    programmed (JEDEC zeros)              */
  89.  
  90. #define VERIFY_HIGH_ERASED 0x12 /* 10010 - Verify high order bits are
  91.                                    erased (JEDEC ones)                   */
  92. #define VERIFY_LOW_ERASED  0x13 /* 10011 - Verify low order bits are
  93.                                    erased (JEDEC ones)                   */
  94.  
  95. #define VERIFY_UES         0x11 /* 10001 - Verify/Load UES bits          */
  96.  
  97. #define FLOW_THRU          0x0E /* 01110 - Put the device in bypass mode */
  98.  
  99. /*4.00 added to support 2032LV*/
  100. #define VERIFY_USERCODE    0x17 /* 10111 - Verify/load 2032LV 32 bits UES*/
  101.  
  102. #define PROG_USERCODE      0x1A /* 11010 - Program 2032LV 32 bits UES*/
  103.  
  104. #define BYPASS             0x1F /* 11111 - By Pass for 2032LV devices 
  105.                                            initialize for other devices*/
  106. #define PROGRAM_ENABLE     0x15 /* 10101 - Read 8 bits ID from devices
  107.                                            and set devices in programming
  108.                                            mode*/
  109.  
  110. /*4.00 for BSCAN programming support*/
  111. #define    idle_state                  0    /* At Run-Test/Idle */
  112. #define    shift_state                 1    /* At Shift-IR*/
  113. #define    execute_state               2    /* At Shift-DR*/
  114. #define    time_state                 -1    /* From Shift-IR to Run-Test/Idle*/
  115.  
  116.  
  117.  
  118. #define DATAROW 4   /*3.05 variable for row to start ues verify*/
  119.  
  120. #define prog_verify   0
  121. #define verify        1
  122. #define verify_ues    2
  123. #define read_show_ues 3
  124.